local data_list = load_excel('数值投放.xlsx','数值强度')
local wages_list = {}
for i=1,20 do
    local data1 = data_list[i*2-1]
    local data2 = data_list[i*2]
    wages_list[i] = data1['金币投放'] + data2['金币投放']
end

function get_wages()
    local day = ac.enemy and ac.enemy.day or 0
    return wages_list[day] or 0
end

ac.game:event '玩家-发工资'(function(_,player)
    local gold = get_wages()
    if gold then
        local ex_gold = gold * player:get('工资加成')/100 + player:get('额外工资')
        player:add('金币',gold + ex_gold)
        player:send_msg(('|cffff9900新的一天！获得|r|cffffff00工资：%0.f|r(|cff00ff00+%0.f|r)|r'):format(gold,ex_gold))
    end
end)

ac.game:event '游戏-发工资'(function(_,day)
    ac.each_player(function(player)
        player:notify('玩家-发工资',player)
    end)
end)